<?php
if (APPLICATION_ENV == 'production') {
    $this->JQuery()->clearJavascriptFiles();
    $this->JQuery()->addJavascriptFile('/js/all.min.js?v='.AC_VERSION);
} else {
    $this->JQuery()->addJavascriptFile('/js/script.js?v='.AC_VERSION);
}

$grid_size = (boolean) (string) $this->placeholder('grid-size');
if (!$grid_size) {
    $grid_size = 16;
} else {
    $grid_size = (string) $this->placeholder('grid-size');
}

Zend_Registry::set('grid-size', $grid_size);

if (APPLICATION_ENV == 'production') {
    $this->headLink()->prependStylesheet('/css/all.css?v='.AC_VERSION);
} else {
    $this->headLink()->prependStylesheet('/css/custom.css?v='.AC_VERSION);
    $this->headLink()->prependStylesheet('/css/theme/sunny.css?v='.AC_VERSION);
    $this->headLink()->prependStylesheet('/css/slideshow/nivo-slider.css?v='.AC_VERSION);
    $this->headLink()->prependStylesheet('/css/sudoCss/Sudostyle.css?v='.AC_VERSION);
    $this->headLink()->prependStylesheet('/css/grid_'.$grid_size.'.css?v='.AC_VERSION);
    $this->headLink()->prependStylesheet('/css/handheld.css?v='.AC_VERSION);
    $this->headLink()->prependStylesheet('/css/style.css?v='.AC_VERSION);
    $this->headLink()->prependStylesheet('/css/reset.css?v='.AC_VERSION);
}

?>
<!doctype html>
<html lang="en" class="no-js">
    <head>
        <meta charset="utf-8">
        <!--[if IE]><![endif]-->
        <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
        <?php echo $this->headTitle() ?>
        <meta name="description" content="">
        <meta name="author" content="AsiaClassified.com - Easy, Free, Local">
        <meta name="viewport" content="width=device-width; initial-scale=1.0; maximum-scale=4.0;">
        <link rel="shortcut icon" href="/favicon.ico">
        <link rel="apple-touch-icon" href="/apple-touch-icon.png">
        <link rel="stylesheet" href="/css/style.css">
        <link rel="stylesheet" media="handheld" href="/css/handheld.css">
        <link rel="stylesheet" href="/css/grid_12.css">
        <link rel="stylesheet" href="/css/grid_16.css">
        <link rel="stylesheet" href="/css/custom.css">
        <link rel="stylesheet" href="/css/custom_ad_detail.css">
        <?php if (!empty($this->canonical)):?>
            <link rel="canonical" href="<?php echo 'http://'.$_SERVER['SERVER_NAME'].$this->canonical?>" />
        <?php endif;?>
        <script src="/js/modernizr-1.5.min.js"></script>
        <?php echo $this->headLink() ?>
        <?php echo $this->headStyle() ?>

    </head>
    <!--[if lt IE 7 ]> <body class="ie6 index"> <![endif]-->
    <!--[if IE 7 ]>    <body class="ie7 index"> <![endif]-->
    <!--[if IE 8 ]>    <body class="ie8 index"> <![endif]-->
    <!--[if IE 9 ]>    <body class="ie9 index"> <![endif]-->
    <!--[if gt IE 9]>  <body class="index">             <![endif]-->
    <!--[if !IE]><!--> <body>         <!--<![endif]-->

        <div id="container" class="container container_12 ad_detail">

            <?php echo $this->Partial('index/header.phtml', 'default'); ?>
            <article>
                <p id="listing_search_action">
                    <?php if (!empty($this->search)):?>
                        <span id="back_result">
                            <a href="<?php echo $this->search->url?>">
                                <span>&lt;</span>
                                Back to result
                            </a>
                        </span>
                    <?php endif;?>
                    <span id="listedin">
                        Listed in Category:
                    <?php if (!empty($this->listing->category)): ?>
                            <?php $tmp = $this->listing->category[0]->getParentTree();?>
                            <?php foreach((array)$tmp as $k => $cat):?>
                                <a href="<?php echo $cat->url()?>"><?php echo $cat->name?></a> &raquo;
                            <?php endforeach;?>
                        <?php endif;?>
                    </span>
                    <span id="prev_next">
                        <a href="#">&lt; Previous Ad</a>
                        <a href="#"> Next Ad &gt;</a>
                    </span>
                </p>
                <h1>
                    <em><?php echo $this->listing->title?></em>
                </h1>

                <?php echo $this->layout()->content; ?>

                <aside class="aside grid_4">
                    <?php echo $this->partial('index/header-part2.phtml', 'default');?>
                    <?php echo $this->placeholder('sidebar-right');?>
                </aside>

            </article>
            <?php echo $this->placeholder('fullwidth-content');?>
            <footer class="footer grid_<?php echo $grid_size?>">
                <?php echo $this->Partial('index/footer.phtml', 'default'); ?>
            </footer>
        </div>
        <!--! end of #container -->
        <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script>
        <script>!window.jQuery && document.write('<script src="js/jquery-1.4.2.min.js"><\/script>')</script>
        <!--script src="/js/plugins.js?v=1"></script-->
        <script src="/js/script.js?v=1"></script>

        <!--[if lt IE 7 ]>
            <script src="js/dd_belatedpng.js?v=1"></script>
          <![endif]-->

        <!--script src="/js/profiling/yahoo-profiling.min.js?v=1"></script>
        <script src="/js/profiling/config.js?v=1"></script-->
        <!-- Javascript at the bottom for fast page loading -->
        <!-- Grab Google CDN's jQuery. fall back to local if necessary -->
        <!--script src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script>
        <script>!window.jQuery && document.write('<script src="/js/jquery-1.4.2.min.js"><\/script>')</script-->
        <?php echo $this->headScript() ?>
        <?php echo $this->JQuery() ?>
                <!--script src="/js/plugins.js?v=1"></script-->

                <!--[if lt IE 7 ]>
                  <script src="/js/dd_belatedpng.js?v=1"></script>
                <![endif]-->

        <?php /*
                  <!-- yui profiler and profileviewer - remove for production -->
                  <script src="/js/profiling/yahoo-profiling.min.js?v=1"></script>
                  <script src="/js/profiling/config.js?v=1"></script>
                  <!-- end profiling code -->
                 */ ?>

        <?php if (defined('GOOGLE_ANALYTICS')): ?>
                    <!-- asynchronous google analytics: mathiasbynens.be/notes/async-analytics-snippet
                         change the UA-XXXXX-X to be your site's ID -->
                    <script>
                        var _gaq = [['_setAccount', '<?php echo GOOGLE_ANALYTICS ?>'], ['_trackPageview']];
                        (function(d, t) {
                            var g = d.createElement(t),
                            s = d.getElementsByTagName(t)[0];
                            g.async = true;
                            g.src = '//www.google-analytics.com/ga.js';
                            s.parentNode.insertBefore(g, s);
                        })(document, 'script');
                    </script>
        <?php endif; ?>
        <?php echo $this->placeholder('at-the-bottom');?>
    </body>
</html>